package unit03.day04;

import java.util.ArrayList;
import java.util.Collection;

import unit03.day02.ObjectDemo1;

/**
 * 删除集合元素
 * */
public class CollectionDemo1 {

	public static void main(String[] args) {
		Collection c = new ArrayList();
		c.add(new ObjectDemo1(1,2));
		c.add(new ObjectDemo1(3,4));
		c.add(new ObjectDemo1(3,4));
		c.add(new ObjectDemo1(5,6));
		ObjectDemo1 ob = new ObjectDemo1(3,4);
		//只删除集合第一个匹配到的元素
		c.remove(ob);
		System.out.println(c);
		
	}
	

}
